function xmlhttpPost() {
    var xhr;
    var method = "GET";
    if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
        xhr = new XMLHttpRequest();
        if ("withCredentials" in xhr) {
            xhr.open(method, jsonendpoint, true);
        }
        else if (typeof XDomainRequest != "undefined") {
            //xhr = new XDomainRequest();
            xhr = new ActiveXObject("Microsoft.XMLHTTP");
            xhr.open(method, jsonendpoint);
        } else {
            xhr = null;
        }
    }
    else {// code for IE6, IE5
        xhr = new ActiveXObject("Microsoft.XMLHTTP");
    }

    xhr.onreadystatechange = function () {
        if (xhr.readyState == 4) {
            document.getElementById("maindiv").innerHTML = xhr.responseText;
        }
    };
    xhr.setRequestHeader("Content-type", "application/json");
    xhr.send(/*"condition="+document.getElementById("sql_condition").value*/);
}